package Cn.Sarkar.MMS.DataBaseDefinations.Independent

import Cn.Sarkar.Entities.Common.Table
import Cn.Sarkar.EntityDream.CoreEngine.RDBMS.Core.Extensions.*
import Cn.Sarkar.MMS.DataBaseDefinations.Additional.Descriptions
import Cn.Sarkar.MMS.DataBaseDefinations.Additional.Names
import Cn.Sarkar.MMS.DataBaseDefinations.Independent.Wallet.MemberShipLevels

object ApplicationDomains : Table("ApplicationDomains") {
    override var Comment: String = "ئەپ تەسىر دائىرىسى"
    val NameID = intColumn("NameID") unsigned true notNull true reference Names.ID comment "ئىسمى"
    val AppKey = charColumn("AppKey") isN false size 32
    val DescriptionID = intColumn("DescriptionID") unsigned true notNull true reference Descriptions.ID comment "چۈشەندۈرۈش"
    val CompanyID = intColumn("CompanyID") reference Companies.ID comment "شىركەت"
    //    var Accounts: MutableList<IAccount>
//    var Wallets: MutableList<IWallet>
    val DefaultMemberShipLevelID = intColumn("DefaultMemberShipLevelID") reference MemberShipLevels.ID ignoreCreateForeignKey true comment "سۈكۈتتىكى ئەزا دەرىجىسى"
//    var MemberShipLevels: MutableList<IMemberShipLevel>

    init {
        index(AppKey) unique true
    }

    override val CATEGORY: Int = 1
}